#pragma once

struct NotchFilter
{
    typedef struct
    {
        double k1;
        double k2;
        double k3;
        double m1;
        double m2;
    } ADaptNotchPara;
    static const int F_NUM = 60;
    // 采样频率125 HZ, 实际陷波频率对应值 5 ： 1 ： 60
    const static double BASIC_FREQUENCY[F_NUM];
    const static double ANGEL_FREQUENCY[F_NUM];
    double y_n1;  // last period value of output
    double y_n2;  // last tow period value of output
    double x_n1;  // last period value of input
    double x_n2;  // last tow period value of input
    void reset();
    double calCenterFrequency(double qd, double k);
    double interp(const double* X, const double* Y, double x);
    ADaptNotchPara calNotchPara(double F, double depth, double Fs);
    double do_filter(double qd, double input, double Fs, double k, double depth);
};
